package com.imooc.newretail.common.exceptions;

import com.imooc.newretail.bpl.enums.ErrCode;
import com.imooc.newretail.bpl.enums.ErrCodeEnum;

/**
 * @program:new-retail-teach
 * @description:自定义业务异常
 * @author:Hank.He
 * @create:2020-06-27 13:19
 **/
public class BizException extends RuntimeException {
    private Integer code;

    public BizException(ErrCode errCode) {
        super(errCode.getMessage());
        this.code = errCode.getCode();
    }

    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
